<template>
	<view>
		<!-- 插屏广告 -->
		<ad-interstitial ref="adRewardedInter" adpid="1624858688" v-slot:default="{adInterLoading, adIntererror}"
			@load="onadInterLoad" @close="onadInterClose" @error="onadInterError">
			<view v-if="adIntererror">{{adIntererror}}</view>
		</ad-interstitial>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			onadInterLoad(e) {
				//插屏广告加载完毕后弹出，首次打开应用弹出
				if (!uni.getStorageSync('adInterLoading')) {
					uni.setStorageSync('adInterLoading', 1);
					this.$refs.adRewardedInter.show();
				}
			},
			onadInterClose(e) {
				console.log("onadclose", e);
			},
			onadInterError(e) {
				// 广告加载失败
				console.log("onaderror: ", e.detail);
			}
		}
	}
</script>

<style>

</style>
